home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # ----------------------------------------------------------
- # This shell script demonstarates how to use colorization on
- # linux console
- # ----------------------------------------------------------
- # My TERM environment variable is set as "linux" in /etc/pprofile
- # Check yours.
-
-
- # --------------------
- # Define colors
- # --------------------
- COLOR1="\033[0m\033[37;44m" # normal white on blue
- COLOR2="\033[1;6m\033[36;44m" # bright cyan on blue
- COLOR3="\033[1;6m\033[31;40m" # bright red on black
- COLOR_RESET="\033[0m"
-
- # echo -ne means:
- # ||------- Enhanced (allow translations of escape sequences)
- # |-------- No newline
-
- echo -ne $COLOR1
- echo "Hello -- COLOR1"
- echo -ne $COLOR2
- echo "Hello -- COLOR2"
- echo -ne $COLOR3
- echo "Hello -- COLOR3"
- echo -ne $COLOR_RESET
- echo This should be black and white now
-
- # reset restores all terminal properties and clears the screen
- # reset
-
-